﻿<!DOCTYPE html>
<html lang="en" window-frame="solid" window-icon="./view/icon/server-favicon.ico"></html>
<head>
	<title></title>
	<link rel="stylesheet" type="text/css" href="./view/css/index.css">
</head>
<body role="window-caption">
	<div id="box">
		<div class="title_box skinbg">
			<div class="head">
				<div class="title fl" >
						<a href="./view/index.html" class="backicon topiconBg"></a>
				</div>
				
				<div class="setting fr">
					<ul>
						<li class="setbtn">
							<span class="setbtnicon topiconBg"></span>
							<ul class="setmess">
								<li>
									<button id="passwordmode" class="passwordicon">更改密码</button>
								</li>
								<li>
									<button id="logoutmode" class="logouticon">切换账户</button>
								</li>
								<li>
									<button id="exitmode" class="exiticon">退出</button>
								</li>
								<li>
									<button id="aboutmode" class="abouticon">关于</button>
								</li>
							</ul>
						</li>
						<li id="minimized">
							<button id="minimized" class="minimizedicon topiconBg"></button>
						</li>
						<li id="closewin">
							<button id="closewin" class="closewinicon topiconBg"></button>
						</li>
					</ul>
				</div>
			</div>
			<div class="detail_title">
				<div class="detailicon copemessicon fl"></div>
				<div class="detailword fl">
					<h3 class="detailh3">备份详情</h3>
					<p class="detailp">恢复简单，避免数据损坏</p>
				</div>
			</div>
		</div>
		<div class="showmess">
			<div class="nonebox">
				<img src="./view/img/NOneimg.png" alt="">
				<p>暂无数据</p>
			</div>
			<div class="detailsbox disp">
				<div class="showtable database">
					<table border="0" cellpadding="0" cellspacing="0">
						<thead>
							<tr>
								<th>数据库编号</th>
								<th>备份数据库</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody class="respbase">
									
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<!-- 提示 -->
        <div id="messtip">
			<i id="messtipicon" class="successicon"></i>
			<!-- 成功 successicon 失败 defeaticon -->
			<span class="messtipword">您的操作 <span class="reminderhandle"></span>！<span class="errorhandle"></span> </span>
		</div>
		<!-- 提示 -->
	</div>
	<script type="text/tiscript" src="./view/tiscript/index.tis"></script>
	<script type="text/tiscript" src="./view/tiscript/public.tis"></script>
	<script type="text/tiscript">
        self.ready = function() {
			// 有数据
			
			var resp_dlist  = view.getdatabaselist();
			$(.respbase).html = database(resp_dlist);

		}
	
			event click $(button) (evt, element) {     
				if(this.attributes["clickname"]){
				// this表示触发事件的元素	
					var databaseid = this.attributes["clickname"];
					var respflist = view.getdatafilelist(toInteger(databaseid));
					view.dialog({
						//加载到对话框中的URL，可加载本地文件
						url: "./view/cpoemysqlmess.html",
						//对话框的x，y坐标
						x: 0,
						y: 0,
						//窗口的宽度，高度
						width: 647,
						height: 467,
						//是否是客户区，如果为真，那么x，y，width，height作为客户区坐标，而不是窗口
						client: false,
						//对话框参数
						parameters: {"newin":view,"respflist":respflist,"success":success,"error":error},
						//对话框标题
						caption: "新对话框",
						//相对于屏幕窗口对齐
						alignment: 1,
					});
				}
	        }

            function database(resp){
				var restb = ""
				var idarr = []
				if(resp || resp.length > 0){
					idarr = []
					for (var (key,val) in resp){
						restb += 
						`
							<tr >
								<td>`+toInteger(val.id)+`</td>
								<td>`+val.database_name+`</td>
								<td class="button">
									<button class="layui-btn" type="mess" clickname="`+toInteger(val.id)+`">详情</button>
	                            </td>
							</tr>
						`
					}
					$(.nonebox).style["display"] = "none"
					$(.disp).style["display"] = "block"

					return restb
				}else{
					$(.nonebox).style["display"] = "block"
					$(.disp).style["display"] = "none"
				}
			}


			
		</script>
	</body>
</html>